/**
 * 续租任务
 */
export default class RenewalTask {
    _time;

    start(ttl=10, cb) {
        const interval = ttl / 3;
        this._time = setInterval(() => {
            if (cb) cb(); // 续租，刷新值
        }, interval);
    }

    stop() {
        clearInterval(this._time);
    }
}
